package com.diditech.iov.gps.api.report.domain;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.util.Date;

/**
 * @author zhjd <br>
 * @date 2023/6/1 <br>
 */
@Data
public class ReportGpsDataBase {

    private String deviceNum;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date gpsTime;
    /**
     * 纬度，坐标系根据请求返回
     */
    private Double lat;
    /**
     * 经度，坐标系根据请求返回
     */
    private Double lng;
    /**
     * 方向
     */
    private String direction;
    /**
     * 是否点火
     */
    private Boolean isAccOn;
    /**
     * 是否行驶
     */
    private Boolean isMoving;

    private String status;
    /**
     * 地址
     */
    private String address;

    public void buildStatus() {
        String status = isMoving ? "行驶" : "停车";
        status += " ";
        status += isMoving ? "点火" : "熄火";
        setStatus(status);
    }
}
